package webdemo;

import java.awt.*;
import javax.swing.*;

public class LoggingWindow extends JFrame {
	private JTextArea textArea;

	public LoggingWindow(String title, final int width, final int height) {
		super(title);
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				setSize(width, height);
				textArea = new JTextArea();
				JScrollPane pane = new JScrollPane(textArea);
				textArea.setEditable(false);
				getContentPane().add(pane);
				setVisible(true);
			}
		});
	}

	public void addLogInfo(final String data) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				textArea.append(data);
			}
		});
	}
}